﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using nPress.Core.Entities;

namespace nPress.Core.Mapping
{
    public class TermMap : MapBase<Term>
    {
        public TermMap()
            : base("terms")
        {
            #region SQL
            /*CREATE TABLE terms (
 term_id bigint(20) unsigned NOT NULL auto_increment,
 name varchar(200) NOT NULL default '',
 slug varchar(200) NOT NULL default '',
 term_group bigint(10) NOT NULL default 0,
 PRIMARY KEY  (term_id),
 UNIQUE KEY slug (slug),
 KEY name (name)*/
            #endregion

            Id(x => x.Id, TableBaseName + "_id");
            Map(x => x.Name, "name").WithLengthOf(200).Not.Nullable();
            Map(x => x.Slug, "slug").WithLengthOf(200).Not.Nullable();
            Map(x => x.TermGroup, TableBaseName + "_group").Not.Nullable();
        }

    }
}
